package org.kongqian.car.service.impl;

import org.kongqian.car.domain.CarResources;
import org.kongqian.car.mapper.CarResourcesMapper;
import org.kongqian.car.service.ICarResourcesService;
import org.kongqian.basic.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author kq
 * @since 2022-11-03
 */
@Service
public class CarResourcesServiceImpl extends BaseServiceImpl<CarResources> implements ICarResourcesService {
    @Autowired
    private CarResourcesMapper carResourcesMapper;


    @Override
    @Transactional
    public void insert(CarResources carResources) {
        //先删除再新增
        carResourcesMapper.deleteByCarId(carResources.getCarId());

        super.insert(carResources);
    }
}
